﻿Public Class changepwd
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

	Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click
		Response.Redirect("mainpage.aspx", False)
	End Sub

	Protected Sub btnChange_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnChange.Click
		If GlobalApp.Authen IsNot Nothing Then
			Try
				BL.Officer.ChangePassword(GlobalApp.Authen.offcier_id, Me.txtOldPassword.Text, Me.txtNewPassword.Text, GlobalApp.Authen.offcier_id)
				'Master.Alert("ท่านได้ทำการเปลี่ยนรหัสผ่านเรียบร้อยแล้ว")
				'Me.txtConfirmNewPassword.Enabled = False
				'Me.txtNewPassword.Enabled = False
				'Me.txtOldPassword.Enabled = False
				'Me.btnChange.Enabled = False
				GlobalApp.DepositMessage = "ท่านได้ทำการเปลี่ยนรหัสผ่านเรียบร้อยแล้ว"
				Response.Redirect("~/mainpage.aspx", False)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Master.Alert(ex.Message)
			End Try
		End If
	End Sub
End Class